#include <iostream>
#include<cstring>
using namespace std;
void reverse(int* a, int left, int right)
{
    while (left < right)
    {
        int tmp = 0;
        tmp = a[left];
        a[left] = a[right];
        a[right] = tmp;
        left--;
        right--;

    }




}
void rotate(int* nums, int numsSize, int k)
{
    k %= numsSize;
    reverse(nums, 0, numsSize - 1);
    reverse(nums, numsSize - k, numsSize - 1);
    reverse(nums, 0, numsSize - 1);
}
